package com.kancy.jemeter.util;

/**
 * @author kancy
 * @date 2019/6/29 20:23
 */
public class EmailUtil {
	private static final String[] email_suffix="@gmail.com,@yahoo.com,@msn.com,@hotmail.com,@aol.com,@ask.com,@live.com,@qq.com,@0355.net,@163.com,@163.net,@263.net,@3721.net,@yeah.net,@googlemail.com,@vcredit.com,@cangoonline.com,@126.com,@sina.com,@sohu.com,@yahoo.com.cn".split(",");
	private static final char[] charArray = "_123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM".toCharArray();

	/**
	 * 返回Email
	 * @return
	 */
	public static String create(String suffix) {
		StringBuffer sb = new StringBuffer();

		int cl = RandomUtil.nextInt(5, 15);
		for (int i = 0; i <cl ; i++) {
			sb.append(charArray[RandomUtil.nextInt(0, charArray.length)]);
		}
		sb.append(suffix);
		return sb.toString();
	}
	public static String create() {
		return create(email_suffix[RandomUtil.nextInt(0, email_suffix.length)]);
	}

}
